﻿@{
    Layout = null;
}

<style type="text/css">
    .dropdown:hover > .dropdown-menu {
        display: block;
    }
</style>

<div id="nav_wrapper">
    <div class="navbar nav_cls white_nav z-depth-1" style="margin-bottom: 20px;">

        <div class="container-fluid">
            <!-- logo和折叠按钮 -->
            <div class="navbar-header">
                <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#main_nav">
                    <span class="sr-only">Toggle navigation</span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </button>
                <a class="navbar-brand logo-img" href="/page/home/" target="_self">
                    @(web_name)
                </a>
            </div>

            <!-- 导航 -->
            <div class="collapse navbar-collapse" id="main_nav">

                <ul class="nav navbar-nav navbar-left">
                    <li>
                        <a href="/dashboard/index/" target="_self">报表</a>
                    </li>
                    <li>
                        <a href="/room/roomlist/" target="_self">客房</a>
                    </li>
                    <li>
                        <a href="/order/orderlist/" target="_self">订单</a>
                    </li>
                    <li>
                        <a href="/finance/index/" target="_self">财务</a>
                    </li>
                    <li>
                        <a href="/crm/index/" target="_self">CRM</a>
                    </li>
                    <li>
                        <a href="/member/managerlist/" target="_self">团队</a>
                    </li>
                    <li class="dropdown">
                        <a href="/events/index/" target="_self">动态</a>
                        <ul class="dropdown-menu">
                            <li>
                                <a href="/group/postlist/" target="_self">内部讨论</a>
                            </li>
                        </ul>
                    </li>
                    <li class="dropdown">
                        <a href="/hotel/setting/" target="_self">设置</a>
                        <ul class="dropdown-menu">
                            <li>
                                <a href="/hotel/setting/" target="_self">酒店设置</a>
                            </li>
                            <li>
                                <a href="/room/roomTypeList/" target="_self">房间类型设置</a>
                            </li>
                        </ul>
                    </li>
                </ul>



                <ul class="nav navbar-nav navbar-right">
                    <li>
                        <a href="/page/help/" target="_blank" data-toggle="tooltip" data-placement="bottom" title="帮助">
                            <span class="fa fa-life-ring"></span>
                            <span style="text-indent:-999px;display:inline-block;width:0;">帮助</span>
                        </a>
                    </li>
                    <li>
                        <a href="/hotel/choose/" target="_self">切换酒店</a>
                    </li>
                    <li>
                        <a href="/user/msg/" class="layer_win" target="_blank" data-toggle="tooltip" data-placement="bottom" title="消息" style="color:red;">
                            <span class="fa fa-bell-o"></span>
                            <span><strong>3</strong></span>
                            <span style="text-indent:-999px;display:inline-block;width:0;">消息</span>
                        </a>
                        <script type="text/javascript">
                            $(function () {
                                setInterval(function () {
                                    /*
                                    postJson('/user/msgcount/', {}, function (res) {
                                        if (res && res.success) {
                                            if (res.data == '0') {
                                                //
                                            }
                                            else {
                                                //
                                            }
                                        }
                                    });
                                    */
                                }, 1000 * 30);
                            });
                        </script>
                    </li>
                    @if (this.X.LoginUser != null)
                    {
                        <li class="dropdown">
                            <a href="/user/me/" rel="nofollow" target="_self">
                                <span class="fa fa-user"></span>
                                <span>@(this.X.LoginUser.NickName)</span>
                                <span class="caret"></span>
                            </a>
                            <ul class="dropdown-menu">
                                <li>
                                    <a href="/user/userinfo/" rel="nofollow" target="_self">
                                        <span>个人设置</span>
                                    </a>
                                </li>
                                <li>
                                    <a href="/account/logout/" rel="nofollow" target="_self">
                                        <span>退出</span>
                                    </a>
                                </li>
                            </ul>
                        </li>
                    }
                    else
                    {
                        <li>
                            <a href="/account/login/" rel="nofollow" target="_self">
                                <span class="fa fa-lock"></span>
                                <span>登陆</span>
                            </a>
                        </li>
                    }

                </ul>

            </div>
        </div>

    </div>
</div>




<script type="text/javascript">
    $(function () {
        var fancy = true;

        var nav_wapper = $('#nav_wrapper');
        var nav = $('.nav_cls');

        $(window).resize(function () {
            if (!fancy) {
                return;
            }
            nav.addClass('navbar-fixed-top').addClass('z-depth-1');
            if ($('body').attr('data-navflow') != 'true') {
                nav_wapper.height(nav.height());
            }
        }).trigger('resize');

        //导航的自动显示和隐藏
        var prevScroll = 0;
        var curDir = 'down';
        var prevDir = 'up';
        $(window).scroll(function () {
            if (!fancy) {
                return;
            }
            if ($(this).scrollTop() > prevScroll) {
                curDir = 'down';
                if (curDir != prevDir) {
                    nav.stop().animate({ top: -1 * nav.height() }, 'fast');
                    prevDir = curDir;
                }
            } else {
                curDir = 'up';
                if (curDir != prevDir) {
                    nav.stop().animate({ top: 0 }, 'fast');
                    prevDir = curDir;
                }
            }
            prevScroll = $(this).scrollTop();
        });

    });
</script>
